﻿Imports MICROFORMA.BEL
Imports MICROFORMA.DAL

Public Class ClienteBL


    Private _Cliente_DA As ClienteDA = Nothing

    Public Function Add(ByVal _ClienteBE As ClienteBE) As String
        If _Cliente_DA.Add(_ClienteBE) = "OK" Then
            If _ClienteBE.Estado = "0" Then
                _ClienteBE.EstadoDescripcion = "Activo"
                Return "OK"
            End If
        End If
    End Function

    Public Function getIdLastRecord() As Integer
        Return _Cliente_DA.getIdLastRecord
    End Function

    Public Function Edit(ByVal _ClienteBE As ClienteBE) As String
        Return _Cliente_DA.Edit(_ClienteBE)
    End Function

    Public Function Delete(ByVal _ClienteBE As ClienteBE) As String
        If _Cliente_DA.Delete(_ClienteBE) = "OK" Then
            If _ClienteBE.Estado = "1" Then
                _ClienteBE.EstadoDescripcion = "Bloqueado"
                Return "OK"
            End If
        End If
    End Function

    Public Function List() As DataTable
        Return _Cliente_DA.List()
    End Function

    Public Function GetList() As DataTable
        Return _Cliente_DA.GetList
    End Function

    Public Sub New()
        _Cliente_DA = New ClienteDA
    End Sub


End Class
